<template lang="html">
  <div class="daily-diet-list">
    <div class="daily-diet-list-container" v-for='(item,index) in data' :key='index'>
      <div class="daily-diet-list-name">{{ item.name }}</div>
      <ul>
        <li class="daily-diet-item" v-for='(ele,index) in item.content' :key='index'>
          <div class="daily-diet-list-pic">
            <img :src="ele.img" alt="">
          </div>
          <div class="daily-diet-list-hide"></div>
          <div class="daily-diet-list-title">{{ ele.title }}</div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name:'DailyDietList',
  data(){
    return{

    }
  },
  props:{
    data:{
      type:Array,
      default:function(){
        return []
      }
    }
  }
}
</script>

<style lang="less" scoped>

.daily-diet-list{
  width: 100%;
  padding: 0.08rem 0.5rem;
  box-sizing: border-box;
  .daily-diet-list-container{
    margin-bottom: 0.08rem;
    .daily-diet-list-name{
      width: 1.19rem;
      height: 0.5rem;
      border-radius: 0.2rem;
      background-color: #43bf92;
      color: #fff;
      font-size: 0.26rem;
      text-align: center;
      line-height: 0.5rem;
      margin-bottom: 0.08rem;
    }
    .daily-diet-item{
      position: relative;
      &:nth-child(2){
        margin: 0.24rem 0;
      }
      img{
        width: 6.5rem;
        height: 1.5rem;
      }
      .daily-diet-list-hide{
        width: 6.5rem;
        height: 1.5rem;
        background-color: rgba(0, 0, 0, .3);
        top: 0;
        left: 0;
        position: absolute;
      }
      .daily-diet-list-title{
        font-size: 0.4rem;
        color: #fff;
        position: absolute;
        top: 0.5rem;
        left: 2.8rem;
      }
    }
  }
}

</style>
